package de.szut.sudoku.gui.menu;

import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

import de.szut.sudoku.main.GameController;

/**
 * ItemListener for the difficulty menu item
 * 
 * @author dqi12huisinga
 * 
 */
public class DifficultyListener implements ItemListener {

	@Override
	public void itemStateChanged(ItemEvent e) {
		GameController
				.getInstance()
				.getdContainer()
				.setCurrentDifficulty(
						GameController
								.getInstance()
								.getdContainer()
								.getDifficultyFromName(
										((DifficultyMenuItem) e.getSource())
												.getRelatedDifficulty()));
	}

}
